home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / Development / TinyGL / ami / content / ad709 / tinygl / src / msghandling.c < prev    next >
Encoding:
C/C++ Source or Header  |  2002-08-15  |  1.5 KB  |  60 lines

  1. /*$T msghandling.c GC 1.137 08/09/02 17:47:18 */
  2.  
  3. /*$6
  4.  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  5.  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  6.  */
  7.  
  8. #include <stdarg.h>
  9. #include <stdio.h>
  10.  
  11. #define NDEBUG
  12.  
  13. #ifdef NDEBUG
  14.     #define NO_DEBUG_OUTPUT
  15. #endif
  16.  
  17. /*
  18.  * Use this function to output messages when something unexpected happens (which
  19.  * might be an indication of an error). Don't* use it when there's internal errors
  20.  * in the code - these should be handled by asserts.
  21.  */
  22. void tgl_warning(const char *format, ...)
  23. {
  24. #ifndef NO_DEBUG_OUTPUT
  25.     va_list args;
  26.     va_start(args, format);
  27.     fprintf(stderr, "*WARNING* ");
  28.     vfprintf(stderr, format, args);
  29.     va_end(args);
  30. #endif /* !NO_DEBUG_OUTPUT */
  31. }
  32.  
  33. /* This function should be used for debug output only. */
  34. void tgl_trace(const char *format, ...)
  35. {
  36. #ifndef NO_DEBUG_OUTPUT
  37.     va_list args;
  38.     va_start(args, format);
  39.     fprintf(stderr, "*DEBUG* ");
  40.     vfprintf(stderr, format, args);
  41.     va_end(args);
  42. #endif /* !NO_DEBUG_OUTPUT */
  43. }
  44.  
  45. /*
  46.  * Use this function to output info about things in the code which should be fixed
  47.  * (missing handling of special cases, important features not implemented, known
  48.  * bugs/buglets, ...).
  49.  */
  50. void tgl_fixme(const char *format, ...)
  51. {
  52. #ifndef NO_DEBUG_OUTPUT
  53.     va_list args;
  54.     va_start(args, format);
  55.     fprintf(stderr, "*FIXME* ");
  56.     vfprintf(stderr, format, args);
  57.     va_end(args);
  58. #endif /* !NO_DEBUG_OUTPUT */
  59. }
  60.